﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="action_edit.aspx.cs" Inherits="MxWeiXinPF.Web.admin.toupiao.action_edit" ValidateRequest="false" %>


<%@ Import Namespace="MxWeiXinPF.Common" %>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0,user-scalable=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <title>编辑大转盘活动</title>
    <%=PageJSAndStype("edit").ToString() %>
    <script type="text/javascript">
        $(function () {
            //初始化表单验证
            $("#form1").initValidform();
            //初始化编辑器
            $(".editor").each(function (i) {
                var objId = $(this).attr("id");
                if (objId != "undefined") {
                    var editor = UE.getEditor(objId, {
                        serverUrl: '../../../tools/upload_ajax.ashx',
                        initialFrameWidth: '100%',
                        initialFrameHeight: 350
                    });
                }
            });
            $(".editor-mini").each(function (i) {
                var objId = $(this).attr("id");
                if (objId != "undefined") {
                    var editorMini = UE.getEditor(objId, {
                        serverUrl: '../../../tools/upload_ajax.ashx',
                        initialFrameWidth: '100%',
                        initialFrameHeight: 250,
                        toolbars: [[
                            'fullscreen', 'source', '|', 'undo', 'redo', '|',
                            'bold', 'italic', 'underline', 'strikethrough', 'removeformat', 'pasteplain', '|', 'forecolor', 'insertorderedlist', 'insertunorderedlist', '|',
                         'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|',
                         'link', 'unlink', 'anchor', '|',
                         'simpleupload', 'insertimage', 'scrawl', 'insertvideo'
                        ]]
                    });
                }
            });

            //初始化上传控件
            $(".upload-img").InitUploader({ filesize: "<%=siteConfig.imgsize %>", sendurl: "../../tools/upload_ajax.ashx", swf: "../../scripts/webuploader/uploader.swf", filetypes: "<%=siteConfig.fileextension %>" });

            $(".upload-album").InitUploader({ btntext: "批量上传", multiple: true, water: true, thumbnail: true, filesize: "<%=siteConfig.imgsize %>", sendurl: "../../tools/upload_ajax.ashx", swf: "../../scripts/webuploader/uploader.swf" });

            //设置封面图片的样式
            $(".photo-list ul li .img-box img").each(function () {
                if ($(this).attr("src") == $("#hidFocusPhoto").val()) {
                    $(this).parent().addClass("selected");
                }
            });

            //创建上传附件
            $(".attach-btn").click(function () {
                showAttachDialog();
            });


            $("#btnSelectImg").click(function () {

                selectmodule("txtUrl");
            });

            function selectmodule(txtUrl) {


                var d = top.dialog({
                    title: '选择模块链接',
                    url: "/admin/dialog/selectmodulelink.aspx",
                    height: 420,
                    width: 440,
                    onclose: function () {

                        var imgUrl = this.returnValue; //获取返回值
                        if (imgUrl.length > 0) {

                            $("#" + txtUrl).val(imgUrl);
                        }


                    }
                }).showModal();

            }

        });

        //初始化附件窗口
        function showAttachDialog(obj) {
            var objNum = arguments.length;
            var attachDialog = top.dialog({
                id: 'attachDialogId',
                title: "上传附件",
                url: 'dialog/dialog_attach.aspx',
                width: 500,
                height: 180,
                onclose: function () {
                    var liHtml = this.returnValue; //获取返回值
                    if (liHtml.length > 0) {
                        $("#showAttachList").children("ul").append(liHtml);
                    }
                }
            }).showModal();
            //如果是修改状态，将对象传进去
            if (objNum == 1) {
                attachDialog.data = obj;
            }
        }
        //删除附件节点
        function delAttachNode(obj) {
            $(obj).parent().remove();
        }

    </script>

</head>

<body class="mainbody">
    <form id="form1" runat="server">
        <!--导航栏-->
        <div class="location">
            <a href="action_list.aspx" class="back"><i class="iconfont icon-up"></i><span>返回投票活动列表</span></a>
            <i class="arrow iconfont icon-arrow-right"></i>
            <span>编辑投票活动</span>
        </div>
        <div class="line10"></div>
        <!--/导航栏-->

        <!--内容-->
        <div id="floatHead" class="content-tab-wrap">
            <div class="content-tab">
                <div class="content-tab-ul-wrap">
                    <ul>
                        <li><a href="javascript:;" onclick="tabs(this);" class="selected">编辑投票活动</a></li>
                        <li><a href="javascript:;" onclick="tabs(this);">分享参数设置</a></li>

                    </ul>
                </div>
            </div>
        </div>

        <div class="tab-content">
            <dl>
                <dt>活动名称</dt>
                <dd>
                    <asp:HiddenField ID="hidid" runat="server" Value="0" />
                    <asp:TextBox ID="txtname" runat="server" CssClass="input normal" datatype="*1-50" sucmsg=" " Text="" />
                    <span class="Validform_checktip">*活动名称</span>
                </dd>
            </dl>

            <dl>
                <dt>活动时间</dt>
                <dd>
                     
                        <asp:TextBox ID="txtstartDate" runat="server"  CssClass="input rule-date-input" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" datatype="/^\s*$|^\d{4}\-\d{1,2}\-\d{1,2}\s{1}(\d{1,2}:){2}\d{1,2}$/" errormsg="请选择正确的日期" sucmsg=" " nullmsg=" " />
                       
                        <span class="Validform_checktip">*必填项</span>
                    
                    到
                        <asp:TextBox ID="txtendDate" runat="server" CssClass="input rule-date-input" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" datatype="/^\d{4}\-\d{1,2}\-\d{1,2}\s{1}(\d{1,2}:){2}\d{1,2}$/" errormsg="请选择正确的日期" sucmsg=" " nullmsg=" " />
                      
                        <span class="Validform_checktip">*必填项</span>
                   


                </dd>
            </dl>

            <dl>
                <dt>活动图片相册</dt>
                <dd>

                    <div class="rule-single-select">
                        <asp:DropDownList ID="ddlAlbumsCategory" runat="server" datatype="*" sucmsg=" "></asp:DropDownList>
                    </div>

                    <span class="Validform_checktip">从微相册分类里取数据</span>

                </dd>
            </dl>
            <dl>
                <dt>每人可投票数</dt>
                <dd>
                    <asp:TextBox ID="txttpTimes" runat="server" CssClass="input small" datatype="n" sucmsg=" ">1</asp:TextBox>
                    <span class="Validform_checktip">*</span>
                </dd>
            </dl>

            <dl>
                <dt>活动说明</dt>
                <dd>
                    <textarea name="txtactContent" id="txtactContent" class="editor-mini"   runat="server"></textarea>
                    <span class="Validform_checktip"></span>
                </dd>
            </dl>


            <dl>
                <dt>简介</dt>
                <dd>
                    <textarea name="txtremark" rows="2" cols="20" id="txtremark" class="input" runat="server" datatype="*0-300" sucmsg=" " nullmsg=" "></textarea>
                    <span class="Validform_checktip"></span>
                </dd>
            </dl>




        </div>
        <div class="tab-content" style="display: none">
            <dl>
                <dt>分享时的图片</dt>
                <dd>
                    <asp:Image ID="imgfxPic" runat="server" ImageUrl="" Style="max-height: 80px;" />
                    <asp:TextBox ID="txtfxPic" runat="server" CssClass="input normal upload-path" datatype="*0-500" sucmsg=" " />
                    <div class="upload-box upload-img"></div>
                    <span class="Validform_checktip">（尺寸：宽400像素，高400像素） 小于200k;</span>
                </dd>
            </dl>

            <dl>
                <dt>分享时的标题</dt>
                <dd>
                    <asp:TextBox ID="txtfxTitle" runat="server" CssClass="input normal" datatype="*0-50" sucmsg=" " Text="" />
                    <span class="Validform_checktip">请不要多于50字!</span>
                </dd>
            </dl>
            <dl>
                <dt>分享时的描述</dt>
                <dd>
                    <textarea name="txtfxContent" rows="2" cols="20" id="txtfxContent" class="input" runat="server" datatype="*0-200" sucmsg=" "></textarea>
                    <span class="Validform_checktip"></span>
                </dd>
            </dl>

        </div>


        <!--/内容-->

        <!--工具栏-->
        <div class="page-footer">
            <div class="btn-list">
                <asp:Button ID="btnSubmit" runat="server" Text="提交保存" CssClass="btn" OnClick="btnSubmit_Click" />
                <a href="dzplist.aspx"><span class="btn yellow">返回上一页</span></a>

            </div>
            <div class="clear"></div>
        </div>
        <!--/工具栏-->
    </form>
</body>
</html>
